import QtQuick 2.2
import QtQuick.Window 2.1

Window {
    visible: true
    width: 360
    height: 360

    Rectangle {
        id: rect1;
        anchors.fill: parent;
//        focus: true;
        Keys.onPressed: {
            console.log("1 focus: " + rect1.focus);
            console.log("2 focus: " + rect2.focus);
            console.log("3 focus: " + rect3.focus);
        }

        Rectangle {
            id: rect2;
            anchors.fill: parent;

//            focus: true;

            Keys.onPressed: {
                console.log("1 focus: " + rect1.focus);
                console.log("2 focus: " + rect2.focus);
                console.log("3 focus: " + rect3.focus);
            }

            Rectangle {
                id: rect3;
                anchors.fill: parent;

                focus: true

                Keys.onPressed: {
                    console.log("1 focus: " + rect1.focus);
                    console.log("2 focus: " + rect2.focus);
                    console.log("3 focus: " + rect3.focus);
                }
            }
        }
    }
}
